<?php
/* @var $this BookController */
/* @var $model Book */

$this->breadcrumbs=array(
	'Books'=>array('index'),
	'Manage',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#book-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="container">
	<ol class="breadcrumb">
		<li><?php echo CHtml::link('首页', array('/site/index'));?></li>
		<li class="active"><?php echo CHtml::link('图书', array('/book/index'));?></li>
	</ol>

    <div class="row">
        <!-- Article main content -->
        <article class="col-md-9 maincontent">
			<header class="page-header">
				<h1 class="page-title">图书管理</h1>
			</header>
            <?php echo CHtml::link('高级搜索','#',array('class'=>'search-button')); ?>
            <div class="search-form" style="display:none">
            <?php $this->renderPartial('_search',array(
            	'model'=>$model,
            )); ?>
            </div><!-- search-form -->

            <?php $this->widget('zii.widgets.grid.CGridView', array(
            	'id'=>'book-grid',
            	'dataProvider'=>$model->search(),
            	'filter'=>$model,
            	'columns'=>array(
                    // 'id',
            		'bookname',
            		array('header'=>'分类','htmlOptions'=>array('style'=>'width: 150px'),'value'=>'$data->type->name'),
            		'author',
            		'browsertimes',
            		'abstract',
            		array('header'=>'投票','value'=>'$data->vote'),
            		/*
            		'content',
                    'price',
                    'picture',
                    'file',
            		*/
            		array(
            			'class'=>'CButtonColumn',
                        'deleteConfirmation' => '你确定要删除该此项吗？',
            		),
            	),
            )); ?>
        </article>
        <!-- /Article -->
        <!-- Sidebar -->
        <aside class="col-md-2 sidebar sidebar-right">

            <div class="row widget">
                <div class="col-xs-12">
                    <h5><?php echo CHtml::link('图书列表', array('/book/index'));?></h5>
                    <h5><?php echo CHtml::link('上传图书', array('/book/create'));?></h5>
                </div>
            </div>
            <div class="row widget">
                <div class="col-xs-12">
                    <p><img src="<?php echo Yii::app()->request->baseUrl; ?><?php echo Yii::app()->request->baseUrl; ?>/Progressus//assets/images/1.jpg" alt=""></p>
                </div>
            </div>
            <div class="row widget">
                <div class="col-xs-12">
                    <p><img src="<?php echo Yii::app()->request->baseUrl; ?><?php echo Yii::app()->request->baseUrl; ?>/Progressus//assets/images/2.jpg" alt=""></p>
                </div>
            </div>

        </aside>
        <!-- /Sidebar -->
    </div>
</div>


